//
//  VCRegisterViewController.m
//  
//
//  Created by VoyageCN on 16/8/18.
//
//

#import "VCRegisterViewController.h"
#import "VCRegisterInPutView.h"// 用户名密码输入View
#import "VCThirdLoginView.h"// 第三方登录View
#import "VCRegisterNextViewController.h"// 注册页面下一步操作

@interface VCRegisterViewController ()

@property (nonatomic, strong) VCRegisterInPutView *registerInPutView;

@property (nonatomic, strong) VCThirdLoginView *thirdLoginView;

@end

@implementation VCRegisterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"注册";
    self.view.backgroundColor = MainColor;
    self.edgesForExtendedLayout = 0;
    [self autoLayout];
    
    
}

- (void)autoLayout {
    
    [self.view addSubview:self.registerInPutView];
    [self.view addSubview:self.thirdLoginView];
    
    __weak typeof(self) weakSelf = self;
    
    [_registerInPutView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.height.equalTo(@230);
        make.left.top.right.equalTo(weakSelf.view);
    }];
    
    [_thirdLoginView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(weakSelf.registerInPutView.mas_bottom);
        make.left.right.equalTo(weakSelf.view);
        make.height.equalTo(@85);
    }];
}



#pragma mark - 懒加载

- (VCRegisterInPutView *)registerInPutView {
    
    if (!_registerInPutView) {
        _registerInPutView = [[VCRegisterInPutView alloc] init];
        __weak typeof(self) weakSelf = self;
        _registerInPutView.nextBlock = ^(NSDictionary *dic){
            VCRegisterNextViewController *next = [[VCRegisterNextViewController alloc] init];
            next.userMessageDic = dic;
            [weakSelf.navigationController pushViewController:next animated:YES];
        };
    }
    return _registerInPutView;
}

- (VCThirdLoginView *)thirdLoginView {
    
    if (!_thirdLoginView) {
        _thirdLoginView = [[VCThirdLoginView alloc] init];
    }
    return _thirdLoginView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
